(define (leaf i)
    i
)

(define (interior-node sym lson rson)
    (list sym lson rson)
)

(define (leaf? bintree)
    (integer? bintree)
)

(define (lson bintree)
    (cadr bintree)
)

(define (rson bintree)
    (caddr bintree)
)

(define (contents-of bintree)
    (if (integer? bintree)
        (list bintree)
        (append 
            (list (car bintree))
            (contents-of (lson bintree))
            (contents-of (rson bintree))
        )
    )
)

(display 
    (leaf? `(foo 1 2))
)

(display 
    (leaf? `1)
)

(display 
    (lson `(bar 1 (foo 1 2)))
)

(display 
    (rson `(bar 1 (foo 1 2)))
)

(display 
    (contents-of
        `(baz
            (bar 1 (foo 1 2))
            (biz 4 5)
        )    
    )
)
